| Total Complexity | 1 |
| Total Lines | 16 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import {Controller, Inject, UseGuards, Query, Get} from '@nestjs/common'; |
||
| 7 | |||
| 8 | @Controller('events') |
||
| 9 | @ApiUseTags('Event') |
||
| 10 | @ApiBearerAuth() |
||
| 11 | @UseGuards(AuthGuard('bearer')) |
||
| 12 | export class GetMonthlyActivitiesAction { |
||
| 13 | constructor( |
||
| 14 | @Inject('IQueryBus') |
||
| 15 | private readonly queryBus: IQueryBus |
||
| 16 | ) {} |
||
| 17 | |||
| 18 | @Get() |
||
| 19 | @ApiOperation({title: 'Get monthly events by user'}) |
||
| 20 | public async index(@Query() dto: MonthlyEventsDTO) { |
||
| 21 | return await this.queryBus.execute( |
||
| 22 | new GetMonthlyEventsQuery(new Date(dto.date), dto.userId) |
||
| 23 | ); |
||
| 26 |